{include file='/public/header'}
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">管理员</a>
        <a>
          <cite>管理员列表</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <table class="layui-table">
        <thead>
          <tr>
            <th>ID</th>
            <th>登录名</th>
            <th>登录次数</th>
            <th>最后登录时间</th>
            <th>操作</th>
        </thead>
        <tbody>
        {volist name="data" id='vo'}
          <tr>
            <td>{$vo.id}</td>
            <td>{$vo.username}</td>
            <td>{$vo.login_count}</td>
            <td>{:date('Y-m-d H:i',$vo.last_time)}</td>
            <td class="td-manage">
              <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" title="编辑" onclick="edit({$vo.id})" href="javascript:;"><i class="layui-icon">&#xe642;</i>编辑</a>
            </td>
          </tr>
        {/volist}
        </tbody>
      </table>
    <script>
      layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form;
        layer = layui.layer;
      });
      /*弹出层*/
      /*
          参数解释：
          title   标题
          url     请求的url
          id      需要操作的数据id
          w       弹出层宽度（缺省调默认值）
          h       弹出层高度（缺省调默认值）
      */
      function edit(id,w,h){
          if (w == null || w == '') {
              w=($(window).width()*0.9);
          };
          if (h == null || h == '') {
              h=($(window).height() - 50);
          };
          layer.open({
              type: 2,
              area: [w+'px', h +'px'],
              fix: false, //不固定
              maxmin: true,
              shadeClose: true,
              shade:0.4,
              title: '密码修改',
              content: '{:url("admins/edit")}?id='+id
          });
      }

      /*关闭弹出框口*/
      function x_admin_close(){
          var index = parent.layer.getFrameIndex(window.name);
          parent.layer.close(index);
      }
    </script>

</html>